For complete information evaluate "Object tgenCopyright."
=================================================
I am an abstract class of scanner that scans a source string and breaks it up into tokens using a minimal deterministic finite-state automata (FSA). Each token is also given a type by its associated final state in the FSA. Specific FSAs are stored in class instance variables of my concrete subclasses.
Instance Variables:
fsa <FSAState> - a local reference to the token recognizer, in minimal deterministic form, for this class of scanner.
For complete information evaluate "Object tgenCopyright."
=================================================
I am an abstract class of scanner that scans a source string and breaks it up into tokens using a character type table and hand-coded scanner methods. Specific type tables are stored in class instance variables of my concrete subclasses.
Instance Variables:
charTypeTable <Array of: Symbol> - a local reference to the type table for this class of scanner; the ascii value of each character is mapped to a symbol token type.
'!
!HandCodedScanner methodsFor: 'state accessing'!
charTypeTable
^charTypeTable!
charTypeTable: argument
charTypeTable := argument! !
!HandCodedScanner methodsFor: 'initialization'!
init
super init.
self charTypeTable: self myTypeTable! !
!HandCodedScanner methodsFor: 'accessing'!
endOfInputToken
"Answer a token representing the end of the input."
^nil!
endOfInputTokenType
"Answer the token type representing the end of the input."
^#doIt!
myTypeTable
^self class charTypeTable! !
!HandCodedScanner methodsFor: 'testing'!
atStartOfComplexToken
"Answer true if the first character of the tokenType is an $x and false otherwise."
^(self tokenType at: 1)
= $x! !
!HandCodedScanner methodsFor: 'scanning'!
scanToken
"Scan the next token and compute its token type. This may be
overridden in subclasses for efficiency and customization."